local files = {"rules.xml;Rules","faq.xml;FAQ","credits.xml;Credits"}
local resX,resY = guiGetScreenSize()

function startup()
	window = guiCreateWindow(resX/10*2,resY/10*2.5,resX/10*6,resY/10*5,"[MTA:RPG] Help",false)
	guiSetVisible(window,false)
	guiWindowSetMovable(window,false)
	guiWindowSetSizable(window,false)
	tPanel = guiCreateTabPanel(0,0.05,1,1,true,window)
	for k, v in ipairs(files) do
		local data = split(v,string.byte(";"))
		local node = xmlLoadFile(data[1])
		local text = xmlNodeGetValue(node)
		local tab = guiCreateTab(data[2],tPanel)
		local memo = guiCreateMemo(0.02,0.04,0.94,0.94,text,true,tab)
		guiMemoSetReadOnly(memo,true)
		xmlUnloadFile(node)
	end
end
addEventHandler("onClientResourceStart",getResourceRootElement(),startup)

function toggle()
	if (guiGetVisible(window)) then
		showCursor(false)
		guiSetVisible(window,false)
	else
		showCursor(true)
		guiSetVisible(window,true)
	end
end
bindKey("F9","down",toggle)